﻿using UnityEngine;
using System.Collections;

public class TextInput : StateMachineBehaviourEx 
{
    Transform _name;
    TypeWritter typeWritter;

    int counter = 0;
    string[] dummySentence = 
    { "This is first sentence", "This is second sentence", "This is third sentence", 
        "This is forth sentence", "This is fifth sentence" };
    

    enum TextStates
    {
        Next
    }

    void Start()
    {
        _name =  transform.Find("Name");
        typeWritter = transform.Find("Sentence").GetComponent<TypeWritter>();

        currentState = TextStates.Next;
    }

    #region Next
    void Next_EnterState()
    {
        _name.guiText.text = "Kirito";
        typeWritter.WriteText(dummySentence[counter++]);
    }

    void Next_Update()
    {
        if (Input.GetMouseButtonDown(0))
            currentState = TextStates.Next;
    }
    #endregion
}
